package com.ws.mapper;


import com.mysql.cj.x.protobuf.MysqlxCrud;
import com.ws.bean.Acl_user;
import com.ws.bean.vo.Acl_userVo;
import org.apache.ibatis.annotations.*;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface Acl_UserMapper {

    @Insert("insert into acl_user(username,password,sex,create_time,update_time,birthday,sid,user_tx) values(#{username},#{password},#{sex},now(),now(),#{birthday},#{sid} ,#{user_tx})")
    int add(Acl_user aclUser);

    List<Acl_user> selAcl_user(Acl_userVo acl_userVo);

    @Delete("delete from acl_user where user_id=#{userId}")
    int delete(Integer userId);

    @Select("select * from acl_user where user_id=#{userId}")
    Acl_user selAcl_userOne(Integer userId);

    @Update("update acl_user set username=#{username},password=#{password},sex=#{sex},birthday=#{birthday},sid=#{sid},update_time=now(),user_tx=#{user_tx} where user_id=#{user_id}")
    int update(Acl_user aclUser);

    @Select("select * from acl_user where username=#{username}")
    Acl_user login(@Param("username") String username);

    @Select("select count(*) from acl_user where sid=#{id}")
    int selectUserBySupplierId(Integer id);
}
